﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Axelerate.Silverlight3D.Media.Media3D;

namespace Axelerate3DEngineUseSamples
{
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();

            // This is necesary only because for some unknown reason the FindName method can reach the AngleRotation. Is something related with the collections but i can't find how to solve it yet.
             
            this.AngleRotation = (((Viewport.Children[1] as ModelVisual3D).Content as Model3DGroup).Transform as RotateTransform3D).Rotation as AxisAngleRotation3D;
            Storyboard.SetTarget(this.AnimRotation, this.AngleRotation);
            this.AnimRotation.Begin();
            
        }
    }
}
